#include <stdio.h>
void fileRW(FILE *fin,FILE *fout);
int main(){
    char fname[20];gets(fname);
        FILE *fpr=fopen(fname,"r");
      FILE *fpw=fopen("file2.txt","w");  
        fileRW(fpr,fpw);
        fclose(fpr);fclose(fpw);
    return 0;
}
/* 请在这里填写答案 */
void fileRW(FILE *fin,FILE *fout)
{
    int line=1;
    int del=1;
    int newline=1;
    for(char c;(c=getc(fin))!=EOF;)
    {
        if(newline)
        {
            fprintf(fout,"%d:",line);
            newline=0;
        }
        if((c==' '||c=='\t')&&del)
        {
            
        }
        else if(c=='\n')
        {
            newline=1;
            ++line;
            del=1;
            fputc(c,fout);
        }
        else
        {
            del=0;
            fputc(c,fout);
        }
    }
}